import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;


public class OneTime extends Appointment {
    //private int year;
    //private int month;
    //private int day;
    
   // private String monthNames[] = {"January","Feburary","March","April","May","June",
    //		                       "July","August","September","October","November","December"};
    
    
    
    public OneTime(){
    	super();
    	
    }
    public OneTime(String descrip, int timeVar, Date dateVar){
    	super(descrip,timeVar,dateVar);
    	//year = yearVar;
    	//month = monthVar;
    	//day = dayVar;
    }
    
    
    /*
	public int getYear() {
		return year;
	}
	public void setYear(int year) {
		this.year = year;
	}
	public int getMonth() {
		return month;
	}
	public void setMonth(int month) {
		this.month = month;
	}
	public int getDay() {
		return day;
	}
	public void setDay(int day) {
		this.day = day;
	}
	*/
	@Override
	public boolean occursOn(int year, String month, int day,String weekDay) {
		if(date.getYear() == year && date.getMonth().equalsIgnoreCase(month) && date.getDay() == day){
			return true;
		}else{
		return false;
		}
	}
	@Override
	public void displayAppointment() {
		// TODO Auto-generated method stub
		System.out.println("************************************");
		System.out.println("One Time Appointment");
		System.out.println("Description: "+ description);
		System.out.println("Time: " + time);
		System.out.println("Year: " + date.getYear());
		System.out.println("Month: " + date.getMonth());
		System.out.println("Day of the month: " + date.getDay() );
		
	}
	@Override
	public Appointment loadAppData(Scanner inStream) {
		// TODO Auto-generated method stub
		int year;
		String month;
		int day;
		String weekDay = "";
		
		description = inStream.nextLine();
		time = inStream.nextInt();
		
		year = inStream.nextInt();
		month = inStream.next();
		day = inStream.nextInt();
		
		
		Date temp = new Date(year,month,day,weekDay);
		date = temp;
		
		return this;
	}
	@Override
	public void saveAppData(PrintWriter output) {
		// TODO Auto-generated method stub
		output.println("One Time");
		output.println(description);
		output.println(time);
		output.println(date.getYear());
		output.println(date.getMonth());
		output.println(date.getDay());
		
	}

	
}
